/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WidokEdytujKontener.java
 *
 * Created on 2011-03-29, 18:00:09
 */

package App.widoki;

import App.kontrolery.KontrolerEdytujKontener;
import App.modele.ModelEdytujKontener;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import skladowisko.dictonaries.StopienZaladunku;
import skladowisko.dictonaries.TypKontenera;

/**
 *
 * @author Krzysiek
 */
public class WidokEdytujKontener extends javax.swing.JFrame {

    private ModelEdytujKontener model = null;
    
    private ComboBoxModel comboTypKontenera;
    private ComboBoxModel comboZaladunekKontenera;

    /** Creates new form WidokEdytujKontener */
    public WidokEdytujKontener(KontrolerEdytujKontener aThis, ModelEdytujKontener model)
    {
        this.model = model;

        initComponents();
        setComboTypValues();
        setComboZaladunekValues();
    }

    private void setComboTypValues()
    {
       comboTypKontenera = new DefaultComboBoxModel(TypKontenera.values());
       jComboBoxTypKontenera.setModel(comboTypKontenera);
    }

      private void setComboZaladunekValues()
    {
       comboZaladunekKontenera = new DefaultComboBoxModel(StopienZaladunku.values());
       jComboBoxStopienZaladunku.setModel(comboZaladunekKontenera);
    }



    //**************************************************************************
    //**************************************************************************
    //**************************************************************************

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTextFieldNumerRozp = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jComboBoxTypKontenera = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jComboBoxStopienZaladunku = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jTextFieldArmator = new javax.swing.JTextField();
        jButtonUstalPolozenie = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        jButtonZapisz = new javax.swing.JButton();
        jButtonAnuluj = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Edytuj dane kontenera");

        jLabel1.setText("Numer rozpoznawczy:");

        jLabel2.setText("Typ kontenera:");

        jLabel3.setText("Stopień załadunku:");

        jComboBoxStopienZaladunku.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " " }));

        jLabel4.setText("Armator:");

        jButtonUstalPolozenie.setText("Ustal położenie");

        jTextField1.setEditable(false);
        jTextField1.setText("nieznane");

        jButtonZapisz.setText("ZAPISZ ZMIANY");
        jButtonZapisz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonZapiszActionPerformed(evt);
            }
        });

        jButtonAnuluj.setText("Anuluj");
        jButtonAnuluj.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAnulujActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jComboBoxTypKontenera, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jTextFieldNumerRozp, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBoxStopienZaladunku, 0, 158, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldArmator, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)))
                        .addGap(89, 89, 89))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jButtonUstalPolozenie)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField1))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jButtonZapisz, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonAnuluj, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextFieldNumerRozp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jComboBoxTypKontenera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jComboBoxStopienZaladunku, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldArmator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonUstalPolozenie)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonZapisz)
                    .addComponent(jButtonAnuluj))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonZapiszActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonZapiszActionPerformed
    {//GEN-HEADEREND:event_jButtonZapiszActionPerformed
        
    }//GEN-LAST:event_jButtonZapiszActionPerformed

    private void jButtonAnulujActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonAnulujActionPerformed
    {//GEN-HEADEREND:event_jButtonAnulujActionPerformed
        
    }//GEN-LAST:event_jButtonAnulujActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                //new WidokEdytujKontener().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAnuluj;
    private javax.swing.JButton jButtonUstalPolozenie;
    private javax.swing.JButton jButtonZapisz;
    private javax.swing.JComboBox jComboBoxStopienZaladunku;
    private javax.swing.JComboBox jComboBoxTypKontenera;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextFieldArmator;
    private javax.swing.JTextField jTextFieldNumerRozp;
    // End of variables declaration//GEN-END:variables

}
